#ifndef MEM_H_INCLUDED
#define MEM_H_INCLUDED

#include <string>
#include <stdint.h>

#define NOT_FOUND -1

enum VarType{VAR_DEFAULT, VAR_STRING, VAR_BOOL, VAR_NUM};

struct var
{
    std::string varName;            // Variable name
    uint8_t varType;                // Variable type
    bool isInit;                    // 'true' if the variable is initialized

    std::string strData;            // String component of variable
    double numData;                 // Numeric component of variable
    bool boolData;                  // Boolean component of variable
};

void listVars();
bool addVar(const std::string& _varName, uint8_t _varType, bool _isInit, const std::string& _strData, \
            double _numData, bool _boolData);

bool removeVar(const std::string& _varName);
int isVarExist(const std::string& _varName);
uint8_t getVarType(const std::string& _varName);
double getNumData(const std::string& _varName, int nLine);
std::string getStrData(const std::string& _varName, int nLine);
bool getBoolData(const std::string& _varName, int nLine);
bool isVarInit(const std::string& _varName, int nLine);
void storeData(const std::string& _varName, bool data, int nLine);
void storeData(const std::string& _varName, double data, int nLine);
void storeData(const std::string& _varName, const std::string& data, int nLine);

#endif // MEM_H_INCLUDED
